//
//  HistoryCell.m
//  MonitoringNetwork
//
//  Created by admin on 2017/12/7.
//  Copyright © 2017年 wtmcxlm. All rights reserved.
//

#import "HistoryCell.h"
#import "UILabel+BasicAttributes.h"
#import "VehicleListModel.h"
@interface HistoryCell()
@property (nonatomic,strong)UILabel *plateLabel;
@property (nonatomic,strong)UILabel *vinLabel;
@end

@implementation HistoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    UIView *lineView = [UIView new];
    lineView.backgroundColor = [UIColor colorWithRed:0.81f green:0.81f blue:0.81f alpha:1.00f];
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(self);
        make.height.mas_equalTo(kHeightOfPt(2));
    }];
    
    _plateLabel = [UILabel LabelWithFont:SmallFontSize andColor:[UIColor colorWithRed:0.20f green:0.20f blue:0.20f alpha:1.00f] andTextAlignment:left];
    _plateLabel.text = @"车牌号 : 粤B88888";
    [self addSubview:_plateLabel];
    [_plateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(kWidthOfPt(76));
        make.centerY.mas_equalTo(self);
    }];
    
    _vinLabel = [UILabel LabelWithFont:SmallFontSize andColor:[UIColor colorWithRed:0.20f green:0.20f blue:0.20f alpha:1.00f] andTextAlignment:left];
    _vinLabel.text = @"VIN : 9999999999999999";
    [self addSubview:_vinLabel];
    [_vinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_centerX).offset(kWidthOfPt(26));
        make.centerY.mas_equalTo(self);
    }];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _plateLabel.text = [NSString stringWithFormat:@"车牌号: %@",_model.plateNum];
    _vinLabel.text = [NSString stringWithFormat:@"VIN: %@",_model.frameNum];
}

@end
